package com.starview.star.operators.io;

import com.starview.star.operators.Builtin;
import com.starview.star.operators.Intrinsics;
import com.starview.star.operators.io.runtime.BasicIo.*;
import com.starview.star.operators.io.runtime.IOHandle;
import com.starview.star.operators.io.runtime.OpenIO.CloseFile;
import com.starview.star.operators.io.runtime.OpenIO.Connect;
import com.starview.star.operators.io.runtime.OpenIO.OpenInfile;
import com.starview.star.operators.io.runtime.OpenIO.OpenOutfile;

public class BasicIo{
  public static void declare(Intrinsics cxt){
    IOHandle.declare(cxt);

    cxt.declareBuiltin(new Builtin(Connect.name, Connect.type(), Connect.class));
    cxt.declareBuiltin(new Builtin(OpenInfile.name, OpenInfile.type(), OpenInfile.class));
    cxt.declareBuiltin(new Builtin(OpenOutfile.name, OpenOutfile.type(), OpenOutfile.class));
    cxt.declareBuiltin(new Builtin(CloseFile.name, CloseFile.type(), CloseFile.class));
    cxt.declareBuiltin(new Builtin(AtEof.name, AtEof.type(), AtEof.class));

    cxt.declareBuiltin(new Builtin(ReadLn.name, ReadLn.type(), ReadLn.class));
    cxt.declareBuiltin(new Builtin(ReadAll.name, ReadAll.type(), ReadAll.class));
    cxt.declareBuiltin(new Builtin(ReadChar.name, ReadChar.type(), ReadChar.class));
    cxt.declareBuiltin(new Builtin(WriteLn.name, WriteLn.type(), WriteLn.class));
    cxt.declareBuiltin(new Builtin(WriteStr.name, WriteStr.type(), WriteStr.class));

    cxt.declareBuiltin(new Builtin(ReadQuoted.name, ReadQuoted.type(), ReadQuoted.class));
  }
}
